from sqlalchemy import Column, Integer, String

from .base import BaseModel


class Banner(BaseModel):
    __tablename__ = "banner"
    __doc__ = "banner表"

    id = Column(
        Integer,
        primary_key=True,
        index=True,
        autoincrement=True, 
        comment="自增主键"
    )

    img_url = Column(String(500), nullable=False, comment="图片地址")
    img_name = Column(String(126), nullable=False, comment="图片名称")
    params = Column(String(500), nullable=False, comment="跳转参数")
    is_delete = Column(
        Integer,
        nullable=False,
        default=0,
        comment="是否删除(1=已删除,0=正常)"
    )